<?php
/**
 * Joomla! 1.5 component JoomGPSTracks
 *
 * @version $Id: default.php 2009-06-24 15:40:19 svn $
 * @author Michael Pfister
 * @package joomGPStracks
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */
 
defined('_JEXEC') or die('Restricted access');

// toolbar
JToolBarHelper::title(JText::_('GPS_TRACKS'), 'categories.png');
JToolBarHelper::back($alt= 'Back', $href= 'javascript:history.back();');
JToolBarHelper::spacer();
JToolBarHelper::addNew('newtrack', 'New', 'new.png' );
JToolBarHelper::editList('editTrack');
JToolBarHelper::publish();
JToolBarHelper::unpublish();
JToolBarHelper::deleteList();
$ordering = ($this->lists['order'] == 'ordering');

?>
    <form action="index.php" method="post" name="adminForm">
<table>
	<tr>
		<td align="left" width="100%">
			<?php echo JText::_( 'Filter' ); ?>:
			<input type="text" name="search" id="search" value="<?php echo $this->lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
			<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
			<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
		</td>
		<td nowrap="nowrap">
		</td>
	</tr>
</table>
    <table class="adminlist" cellpadding="1">
        <thead>
            <tr>
                <th width="5%" class="title"><?php echo JText::_( 'NUM' ); ?></th>
                <th width="5%" class="title">
                    <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->rows); ?>);" />
                </th>
                <th width="35%" class="title"><?php echo JHTML::_('grid.sort', JText::_( 'GPS_TITLE' ), 'title', @$this->lists['order_Dir'], @$this->lists['order'], 'tracks' ); ?>:</th>
                <th width="20%" class="title"><?php echo JHTML::_('grid.sort', JText::_( 'GPS_CAT' ), 'cat', @$this->lists['order_Dir'], @$this->lists['order'], 'tracks' ); ?>:</th>
        		<th width="13%" class="title"><?php echo JHTML::_('grid.sort', JText::_( 'DATE' ), 'date', @$this->lists['order_Dir'], @$this->lists['order'], 'tracks' ); ?>:
                </th>
                <th width="18%" class="title"><?php echo JHTML::_('grid.sort', JText::_( 'STATE' ), 'published', @$this->lists['order_Dir'], @$this->lists['order'], 'tracks' ); ?>:</th>
                <th width="4%" class="title" nowrap="nowrap">
					<?php echo JHTML::_('grid.sort', JText::_( 'ID' ), 'id', @$this->lists['order_Dir'], @$this->lists['order'], 'tracks' ); ?>:
				</th>
			</tr>
         </thead>
        <tfoot>
            <tr>
                <td colspan="7">
                    <?php echo $this->pagination->getListFooter(); ?>
                </td>
            </tr>
        </tfoot>
         <?php
	$k = 0;
	for ($i=0, $n=count( $this->rows ); $i < $n; $i++)
	{
		$row = &$this->rows[$i];

		$checked 	= JHTML::_('grid.checkedout',   $row, $i );
		$published 	= JHTML::_('grid.published', $row, $i );
        ?>
             <tr class="<?php echo "row$k"; ?>">
                <td align="center"><?php echo $this->pagination->getRowOffset( $i ); ?></td>
                <td align="center"><?php echo $checked; ?></td>
                <td align="center"><?php echo $row->title; ?></td>
                <td align="center"><?php echo $row->cat; ?></td>
                <td align="center"><?php echo $row->date; ?></td>
                <td align="center"><?php echo $published;?></td>
                <td align="center"><?php echo $row->id; ?></td>
             </tr>
             <?php
             $k = 1 - $k;
    }        ?>
         </tbody>
    </table>
    <input type="hidden" name="option" value="com_joomgpstracks" />
    <input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
    <input type="hidden" name="controller" value="tracks" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
    <?php echo JHTML::_( 'form.token' ); ?>
    </table>
    </form>